package handleds;

import bookoperation.*;

import java.util.Scanner;
public class User extends Common{

    //构造方法
    public User(String name) {
        //先实现父类构造方法
        super(name);
        this.iOperations = new IOperation[] {
                new ExitSystem(),
                new BorrowBook(),
                new FindBook(),
                new ShowBook(),
        };

    }


    //重写父类中的menu方法
    public int menu() {
        System.out.println("===========================");
        System.out.println("欢迎["+ name +"]来到图书管理系统");
        System.out.println("1.借阅图书");
        System.out.println("2.查找图书");
        System.out.println("3.展示图书");
        System.out.println("0.退出程序");
        System.out.println("===========================");
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入你的选择:>");
        int choice = scanner.nextInt();
        return choice;
    }
}
